<div class="region-goods-details row">

    <div class="region-goods-left col-sm-2">

        基本信息

    </div>

    <div class="region-goods-right col-sm-10">

        <div class="form-group">

            <label class="col-sm-2 control-label">排序</label>

            <div class="col-sm-9 col-xs-12">

                {ife 'goods' $item}

                <input type="text" name="displayorder" id="displayorder" class="form-control" value="{$item['displayorder']}" />

                <span class='help-block'>数字越大，排名越靠前,如果为空，默认排序方式为创建时间</span>

                {else}

                <div class='form-control-static'>{$item['displayorder']}</div>

                {/if}

            </div>

        </div>

        <div class="form-group">

            <label class="col-sm-2 control-label must">商品名称</label>

            {ife 'goods' $item}

            <div class="col-sm-7"  style="padding-right:0;" >

                <input type="text" name="goodsname" id="goodsname" class="form-control" value="{$item['title']}" data-rule-required="true" />

            </div>

            <div class="col-sm-2" style="padding-left:5px">

                <input type="text" name="unit" id="unit" class="form-control" value="{$item['unit']}" placeholder="单位, 如: 个/件/包"  />

            </div>

            {else}

            <div class='form-control-static'>{$item['title']}</div>

            {/if}

        </div>



        <div class="form-group">

            <label class="col-sm-2 control-label">副标题</label>

            {ife 'goods' $item}

            <div class="col-sm-9 subtitle">

                <textarea id="" name="subtitle" id="subtitle" rows="5"  class="form-control" data-parent=".subtitle" maxlength="100" data-rule-maxlength="100">{$item['subtitle']}</textarea>

                <div class="help-block">副标题的长度请控制在100字以内</div>

            </div>

            {else}

            <div class='form-control-static'>{$item['subtitle']}</div>

            {/if}

        </div>



        <div class="form-group">

            <label class="col-sm-2 control-label">商品短标题</label>

            {ife 'goods' $item}

            <div class="col-sm-9 subtitle">

                <input type="text" name="shorttitle" class="form-control" value="{$item['shorttitle']}" />

                <div class="help-block">商品短标题 用于快递打印,以及小型热敏打印机打印</div>

            </div>



            {else}

            <div class='form-control-static'>{$item['shorttitle']}</div>

            {/if}

        </div>



        <div class="form-group">

            <label class="col-sm-2 control-label">关键字</label>

            {ife 'goods' $item}

            <div class="col-sm-9">

                <input type="text" name="keywords" class="form-control" value="{$item['keywords']}"/>

                <div class="help-block">商品关键字,能准确搜到商品的,比如 : 海尔电视|电视 之类的</div>

            </div>

            {else}

            <div class='form-control-static'>{$item['keywords']}</div>

            {/if}

        </div>



        <div class="form-group">

            <label class="col-sm-2 control-label">商品类型</label>

            <div class="col-sm-9 col-xs-12">

                <input type="hidden" name="goodstype" value="{$item['type']}">

                {ife 'goods' $item}



                <label class="radio-inline"><input type="radio" name="type" value="1" {if !empty($item['id'])}disabled{/if} {if empty($item['type']) || $item['type'] == 1}checked="true"{/if} onclick="type_change(1);" /> 实体商品</label>



                {if com('virtual')}

                    <label class="radio-inline"><input type="radio" name="type" value="2" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 2}checked="true"{/if}  onclick="type_change(2);" /> 虚拟商品</label>

                    <label class="radio-inline"><input type="radio" name="type" value="3" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 3}checked="true"{/if}  onclick="type_change(3);" /> 虚拟物品(卡密)</label>

                {/if}



                <label class="radio-inline"><input type="radio" name="type" value="4" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 4}checked="true"{/if}  onclick="type_change(4);" /> 批发商品</label>



                <label class="radio-inline"><input type="radio" name="type" value="5" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 5}checked="true"{/if}  onclick="type_change(5);" /> 记次/时商品</label>



                {if p('mr')}

                <label class="radio-inline"><input type="radio" name="type" value="10" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 10}checked="true"{/if}  onclick="type_change(10);" /> 话费流量充值</label>

                {/if}



                {if p('ccard')}

                <label class="radio-inline"><input type="radio" name="type" value="20" {if !empty($item['id'])}disabled{/if}  {if $item['type'] == 20}checked="true"{/if}  onclick="type_change(20);" /> 充值卡</label>

                {/if}



                <span class="help-block">商品类型，商品保存后无法修改，请谨慎选择</span>



                {else}

                <div class='form-control-static'>{if empty($item['type']) || $item['type'] == 1}

                    实体物品

                    {elseif $item['type']==2}

                    虚拟物品

                    {elseif $item['type']==3}

                    虚拟物品(卡密)

                    {/if}</div>

                {/if}

            </div>

        </div>
        
        
        <!-- By QQ:834633039 -->
        <div id="isvip" {if $item['type'] != 2}style="display:none;"{/if}>
    	<div class="form-group">
	        <label class="col-sm-2 control-label" style="color:red;">升级为会员</label>
	        <div class="col-sm-8 col-xs-12">
	            <select id="viplevel"  name='viplevel' class="form-control " style='width:605px; background-color: #fff;'>
	            	<option value="0">不设置</option>
	                {loop $levels $level}
	                {if $level['id'] != 0}
	                <option value="{$level['id']}" {if $level['id'] == $item['viplevel']}selected{/if} >{$level['levelname']}</option>
	                {/if}
	                {/loop}
	            </select>
	            <div class="help-block">如果设置了会员等级，购买了此商品后，会自动升级到设置的会员等级</div>
	        </div>
	    </div>
	    </div>
        <!-- By QQ:834633039 -->
	    <div class="form-group">	
	        <label class="col-sm-2 control-label" style="color:red;">会员礼品</label>	
	        <div class="col-sm-9 col-xs-12">	
	            {ife 'goods' $item}	
	            <label class="radio-inline"><input type="radio" name="is_gift" value="0"  {if empty($item['is_gift'])}checked="true"{/if} /> 否</label>	
	            <label class="radio-inline"><input type="radio" name="is_gift" value="1" {if $item['is_gift'] == 1}checked="true"{/if} /> 是</label>	
	            <span class="help-block">提示：如果设置为会员礼品，只有会员等级才能免费领取</span>	
	            {else}	
	            <div class='form-control-static'>{if empty($item['is_gift'])}否{else}是{/if}</div>	
	            {/if}	
	        </div>	
	    </div>
        <!-- By QQ:834633039 -->
        <div class="form-group">
            <label class="col-sm-2 control-label" style="color:red;">是否参与自购返利</label>
            <div class="col-sm-9 col-xs-12">
                {ife 'goods' $item}
                <label class="radio-inline"><input type="radio" name="selfRebate" value="0"  {if empty($item['selfRebate'])}checked="true"{/if} /> 否</label>
                <label class="radio-inline"><input type="radio" name="selfRebate" value="1" {if $item['selfRebate'] == 1}checked="true"{/if} /> 是</label>
                <span class="help-block">提示：如果不参与,会员自购不产生返利</span>
                {else}
                <div class='form-control-static'>{if empty($item['selfRebate'])}否{else}是{/if}</div>
                {/if}
            </div>
        </div>

    </div>

</div>



    <!--商品信息-->

    <div class="region-goods-details row">

        <div class="region-goods-left col-sm-2">

            商品信息

        </div>

        <div class="region-goods-right col-sm-10">

            <div class="form-group dispatch_info" {if !empty($item['type']) && $item['type'] > 1}style="display: none;"{/if}>

            <label class="col-sm-2 control-label">预售设置</label>

            <div class="col-sm-9 col-xs-12">

                {ife 'goods' $item}

                <label class="radio-inline"><input type="radio" name="ispresell" value="0"  {if empty($item['ispresell'])}checked="true"{/if}/> 否</label>

                <label class="radio-inline"><input type="radio" name="ispresell" value="1" {if $item['ispresell'] == 1}checked="true"{/if}   /> 是</label>

                <span class="help-block">提示：是否开启商品预售设置</span>

                {else}

                <div class='form-control-static'>{if empty($item['ispresell'])}否{else}是{/if}</div>

                {/if}

            </div>

        </div>
          
        <!-- code by wengsunjian -->
        <div class="form-group presell_info">

            <label class="col-sm-2 control-label">参加区域代理分红</label>

            <div class="col-sm-9 col-xs-12">

                {ife 'goods' $item}

                <label class="radio-inline"><input type="radio" name="area_agent_bonus" value="0"  {if empty($item['area_agent_bonus'])}checked="true"{/if}/> 否</label>

                <label class="radio-inline"><input type="radio" name="area_agent_bonus" value="1" {if $item['area_agent_bonus'] == 1}checked="true"{/if}   /> 是</label>

                <span class="help-block">提示：是否参加区域代理分红</span>

                {else}

                <div class='form-control-static'>{if empty($item['area_agent_bonus'])}否{else}是{/if}</div>

                {/if}

            </div>

        </div>
        <!-- end code -->

        <div class="form-group presell_info" {if empty($item['ispresell']) || $item['ispresell'] > 1}style="display: none;"{/if}>

        <label class="col-sm-2 control-label must">预售价格</label>

        <div class="col-sm-9 col-xs-12">

            {ife 'goods' $item}

            <div class="input-group">

                <input type="text" name="presellprice" id="presellprice" class="form-control" value="{$item['presellprice']}" />

                <span class="input-group-addon">元</span>

            </div>

            <span class='help-block'>尽量填写完整，有助于于商品销售的数据分析</span>

            {else}

            <div class='form-control-static'>预售：{$item['presellprice']} 元</div>

            {/if}

        </div>

    </div>

    <div class="form-group presell_info" {if empty($item['ispresell']) || $item['ispresell'] > 1}style="display: none;"{/if}>

    <label class="col-sm-2 control-label">预售时间</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <div class="input-group">

                <span class="input-group-addon">

                    <input type="checkbox" name="presellstart" value="1" id="presellstart" {if $item['presellstart'] == 1}checked="true"{/if} />

                    预售开始时间

                </span>

            {php echo tpl_form_field_eweishop_date('preselltimestart', !empty($item['preselltimestart']) ? date('Y-m-d H:i',$item['preselltimestart']) : date('Y-m-d H:i'),true)}

                <span class="input-group-addon">

                    <input type="checkbox" name="presellend" value="1" id="presellend" {if $item['presellend'] == 1}checked="true"{/if} />

                    预售结束时间

                </span>

            {php echo tpl_form_field_eweishop_date('preselltimeend', !empty($item['preselltimeend']) ? date('Y-m-d H:i',$item['preselltimeend']) : date('Y-m-d H:i'),true)}

        </div>

        <span class='help-block'>尽量填写完整，有助于于商品销售的数据分析</span>

        {else}

        <div class='form-control-static'>

            {if $item['ispresell']==1} {php echo date('Y-m-d H:i',$item['preselltimestart'])} - {php echo date('Y-m-d H:i',$item['preselltimeend'])} {/if}

        </div>

        {/if}

    </div>

    </div>

    <div class="form-group presell_info" {if empty($item['ispresell']) || $item['ispresell'] > 1}style="display: none;"{/if}>

    <label class="col-sm-2 control-label">发货时间</label>

    <div class="col-sm-6 col-xs-6" style='padding-left:0'>

        {ife 'goods' $item}

        <div class="input-group">

                <span class='input-group-addon' style='border:none'>

                    <label class="radio-inline" style='margin-top:-7px;' >

                        <input type="radio" name="presellsendtype" value="0" {if empty($item['presellsendtype'])}checked="true"{/if}   /> 固定时间

                    </label>

                </span>

            {php echo tpl_form_field_eweishop_date('presellsendstatrttime', !empty($item['presellsendstatrttime']) ? date('Y-m-d H:i',$item['presellsendstatrttime']) : date('Y-m-d H:i'),true)}

        </div>

        {else}

        <div class='form-control-static'>

            {if $item['presellsendtype']==0}固定时间{/if} {date('Y-m-d H:i',$item['presellsendstatrttime'])}

        </div>

        {/if}

    </div>

    </div>

    <div class="form-group presell_info" {if empty($item['ispresell']) || $item['ispresell'] > 1}style="display: none;"{/if}>

    <label class="col-sm-2 control-label"></label>

    <div class="col-sm-6 col-xs-6" style='padding-left:0'>

        {ife 'goods' $item}

        <div class="input-group">

                <span class='input-group-addon' style='border:none'>

                    <label class="radio-inline"  style='margin-top:-7px;' >

                        <input type="radio"name="presellsendtype" value="1" {if $item['presellsendtype'] == 1}checked="true"{/if}  /> 购买时间

                    </label>

                </span>

            <span class="input-group-addon">购买后</span>

            <input type="text" name="presellsendtime" id="presellsendtime" class="form-control" value="{$item['presellsendtime']}" />

            <span class="input-group-addon">天发货</span>

        </div>

        {else}

        <div class='form-control-static'>

            {if $item['presellsendtype']==1}购买时间{/if} 购买后 {$item['presellsendtime']} 天发货

        </div>

        {/if}

    </div>

    </div>

    <div class="form-group presell_info" {if empty($item['ispresell']) || $item['ispresell'] > 1}style="display: none;"{/if}>

    <label class="col-sm-2 control-label">预售结束设置</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <div class="input-group">

                    <span class="input-group-addon">

                        <input type="checkbox" name="presellover" value="1" id="presellover" {if $item['presellover'] == 1}checked="true"{/if} />

                        预售结束

                    </span>

            <input type="text" name="presellovertime" id="presellovertime" class="form-control" value="{$item['presellovertime']}" />

            <span class="input-group-addon">天后，商品转为正常销售</span>

        </div>

        <span class='help-block'>如不选择，则商品预售结束商品下架</span>

        {else}

        <div class='form-control-static'>

            {if $item['presellover']==1} 预售结束{$item['presellovertime']}天后，商品转为正常销售 {/if}

        </div>

        {/if}

    </div>

    </div>



    <div class="form-group send-group" style="{if $item['type'] != 2}display: none;{/if}">

        <label class="col-sm-2 control-label">自动发货</label>

        <div class="col-sm-9 col-xs-12">

            {ife 'goods' $item}

            <label class="radio-inline"><input type="radio" onclick="type_change(2);" name="virtualsend" value="0"  {if empty($item['virtualsend'])}checked="true"{/if}/> 否</label>

            <label class="radio-inline"><input type="radio" onclick="type_change(2);" name="virtualsend" value="1" {if $item['virtualsend'] == 1}checked="true"{/if}   /> 是</label>

            <span class="help-block">提示：发货后订单自动完成</span>

            {else}

            <div class='form-control-static'>{if empty($item['virtualsend'])}否{else}是{/if}</div>

            {/if}

        </div>

    </div>



    <div class="form-group send-group" style="{if $item['type'] != 2}display: none;{/if}">

        <label class="col-sm-2 control-label">自动发货内容</label>

        <div class="col-sm-9 col-xs-12">

            <textarea class="form-control" name="virtualsendcontent">{$item['virtualsendcontent']}</textarea>

        </div>

    </div>



    {if com('virtual')}

    <div class="form-group" style="{if $item['type'] != 3}display: none;{/if}" id="type_virtual" {if !empty($item['id'])}disabled{/if}>

    <label class="col-sm-2 control-label"></label>

    <div class="col-sm-6 col-xs-6">





        {ife 'goods' $item}

        <select class="form-control select2" id="virtual" name="virtual">

            <option value="0">多规格虚拟物品</option>

            {loop $virtual_types $virtual_type}

            <option value="{$virtual_type['id']}" {if $item['virtual'] == $virtual_type['id']}selected="true"{/if}>{$virtual_type['usedata']}/{$virtual_type['alldata']} | {$virtual_type['title']}</option>

            {/loop}

        </select>

        <span>提示：直接选中虚拟物品模板即可，选择多规格需在商品规格页面设置</span>

        {else}

        {loop $virtual_types $virtual_type}

        {if $item['virtual'] == $virtual_type['id']}{$virtual_type['usedata']}/{$virtual_type['alldata']} | {$virtual_type['title']}{/if}

        {/loop}





        {/if}

    </div>

    </div>

    {/if}



    <div class="form-group">

        <label class="col-sm-2 control-label">商品分类</label>

        <div class="col-sm-8 col-xs-12">

            {ife 'goods' $item}

            <select id="cates"  name='cates[]' class="form-control select2" style='width:605px;' multiple='' >

                {loop $category $c}

                <option value="{$c['id']}" {if is_array($cates) &&  in_array($c['id'],$cates)}selected{/if} >{$c['name']}</option>

                {/loop}

            </select>

            {else}

            <div class='form-control-static ops'>

                {loop $cates $c}

                <a>{$category[$c]['name']}</a>

                {/loop}

            </div>



            {/if}

        </div>

    </div>





    <div class="form-group">

        <label class="col-sm-2 control-label">商品属性</label>

        <div class="col-sm-9 col-xs-12" >

            {ife 'goods' $item}

            <label for="isrecommand" class="checkbox-inline">

                <input type="checkbox" name="isrecommand" value="1" id="isrecommand" {if $item['isrecommand'] == 1}checked="true"{/if} /> 推荐

            </label>

            <label for="isnew" class="checkbox-inline">

                <input type="checkbox" name="isnew" value="1" id="isnew" {if $item['isnew'] == 1}checked="true"{/if} /> 新品

            </label>

            <label for="ishot" class="checkbox-inline">

                <input type="checkbox" name="ishot" value="1" id="ishot" {if $item['ishot'] == 1}checked="true"{/if} /> 热卖

            </label>



            <label for="issendfree" class="checkbox-inline">

                <input type="checkbox" name="issendfree" value="1" id="issendfree" {if $item['issendfree'] == 1}checked="true"{/if} /> 包邮

            </label>



            <label for="isnodiscount" class="checkbox-inline">

                <input type="checkbox" name="isnodiscount" value="1" id="isnodiscount" {if $item['isnodiscount'] == 1}checked="true"{/if} /> 不参与会员折扣

            </label>



            {else} <div class='form-control-static'>

            {if $item['isnew']==1}新品; {/if}

            {if $item['ishot']==1}热卖; {/if}

            {if $item['isrecommand']==1}推荐; {/if}

            {if $item['issendfree']==1}包邮; {/if}

            {if $item['isnodiscount']==1}不参与折扣; {/if}

        </div>

            {/if}

            {if $item['merchid']>0}<span class="help-block">多商户的商品如果设置参与会员折扣，给多商户结算的时候是按照折扣前的价格结算</span>{/if}

        </div>

    </div>

    <div class="form-group price" {if $item['type']==4}  style="display: none"{/if}>

    <label class="col-sm-2 control-label">商品价格</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <div class="input-group">

            <input type="text" name="marketprice" id="marketprice" class="form-control" value="{$item['marketprice']}" />

            <span class="input-group-addon">元 原价</span>

            <input type="text" name="productprice" id="productprice" class="form-control" value="{$item['productprice']}" />

            <span class="input-group-addon">元 成本</span>

            <input type="text" name="costprice" id="costprice" class="form-control" value="{$item['costprice']}" />

            <span class="input-group-addon">元</span>

        </div>

        <span class='help-block'>尽量填写完整，有助于于商品销售的数据分析</span>

        {else}

        <div class='form-control-static'>现价：{$item['marketprice']} 元 原价：{$item['productprice']} 元 成本：{$item['costprice']} 元</div>

        {/if}

    </div>

    </div>

	<!-- code by 鱼河岸小店 -->
	<div class="form-group">

    <label class="col-sm-2 control-label" >厂家成本</label>

    <div class="col-sm-8">

        <input id="thrid_cost_price" class="form-control" name="thrid_cost_price" value="{$item['thrid_cost_price']}">

    </div>
    </div>
    <!-- end code -->



    <div class="form-group interval"  {if $item['type']!=4}  style="display: none"{/if} >

    <label class="col-sm-2 control-label" >批发价格</label>

    <div class="col-sm-2">

        <input type="hidden" id="intervalfloor" name="intervalfloor" value="{$item['intervalfloor']}">

        {ife 'goods' $item}

        <a href="javascript:;" id='add-param' onclick="setinterval('plus')" class="btn btn-default"  title="添加价格区间"><i class='fa fa-plus'></i> 添加价格区间</a>

        {/if}

    </div>

    <div class="col-sm-2">

        {ife 'goods' $item}

        <a href="javascript:;" id='add-param' onclick="setinterval('minus')" class="btn btn-default"  title="添加价格区间"><i class='fa fa-minus'></i> 移除价格区间</a>

        {/if}

    </div>

    <div class="col-sm-5">

        <p style="margin-top: 7px;">批发商品请至少设置一组价格区间，才能正常发布信息。</p>

    </div>



    </div>







    <div class="form-group interval"  {if $item['type']!=4}  style="display: none"{/if} >

    <div class="col-sm-2">

    </div>

    <div class="col-sm-8">

        <div class="input-group"  {if !is_array($intervalprices[0])} style="display: none"{/if}  id="interval1">

        <span class="input-group-addon">购买</span>

        <input type="text" name="intervalnum1" id="intervalnum1" class="form-control" value="{if is_array($intervalprices[0])}{$intervalprices[0]['intervalnum']}{/if}" />

        <span class="input-group-addon">件及以上</span>

        <input type="text" name="intervalprice1" id="intervalprice1" class="form-control" value="{if is_array($intervalprices[0])}{$intervalprices[0]['intervalprice']}{/if}" />

        <span class="input-group-addon">元/件</span>

        <!--<span class="input-group-addon" style="padding:0;">

            <a href="javascript:;" class='btn btn-default btn-sm' style="border:none;" onclick="" title="删除"><i class='fa fa-remove'></i></a>

        </span>-->

    </div>



    <div class="input-group"  {if !is_array($intervalprices[1])} style="display: none"{/if} id="interval2">

    <span class="input-group-addon">购买</span>

    <input type="text" name="intervalnum2" id="intervalnum2" class="form-control" value="{if is_array($intervalprices[1])}{$intervalprices[1]['intervalnum']}{/if}" />

    <span class="input-group-addon">件及以上</span>

    <input type="text" name="intervalprice2" id="intervalprice2" class="form-control" value="{if is_array($intervalprices[1])}{$intervalprices[1]['intervalprice']}{/if}" />

    <span class="input-group-addon">元/件</span>

    <!--<span class="input-group-addon" style="padding:0;">

        <a href="javascript:;" class='btn btn-default btn-sm' style="border:none;" onclick="" title="删除"><i class='fa fa-remove'></i></a>

    </span>-->

    </div>



    <div class="input-group" {if !is_array($intervalprices[2])} style="display: none"{/if} id="interval3">

    <span class="input-group-addon">购买</span>

    <input type="text" name="intervalnum3" id="intervalnum3" class="form-control" value="{if is_array($intervalprices[2])}{$intervalprices[2]['intervalnum']}{/if}" />

    <span class="input-group-addon">件及以上</span>

    <input type="text" name="intervalprice3" id="intervalprice3" class="form-control" value="{if is_array($intervalprices[2])}{$intervalprices[2]['intervalprice']}{/if}" />

    <span class="input-group-addon">元/件</span>

    <!--<span class="input-group-addon" style="padding:0;">

        <a href="javascript:;" class='btn btn-default btn-sm' style="border:none;" onclick="" title="删除"><i class='fa fa-remove'></i></a>

    </span>-->

    </div>

    </div>

    </div>







    {if p('offic')}

    <div class="form-group">

        <label class="col-sm-2 control-label">文案营销长图</label>

        <div class="col-sm-9 col-xs-12">

            {ife 'goods' $item}

            {php echo tpl_form_field_image2('officthumb', $item['officthumb'])}

            <span class='help-block'>营销专用商品长缩略图</span>

            {else}

            {if !empty($item['officthumb'])}

            <a href="{php echo tomedia($item['officthumb'])}" target="_blank">

            <img src="{php echo tomedia($item['officthumb'])}" style="width:100px;border:1px solid #ccc;padding:1px" />

            </a>

            {/if}

            {/if}

        </div>

    </div>

    {/if}

    <div class="form-group">

        <label class="col-sm-2 control-label must">商品图片</label>

        <div class="col-sm-9 col-xs-12 gimgs">

            {ife 'goods' $item}

            {php echo tpl_form_field_multi_image2('thumbs',$piclist)}

            <span class="help-block image-block">第一张为缩略图，其他为详情页图片，尺寸建议宽度为640，并保持图片大小一致，图片大小依照首图尺寸显示，不显示首图时依照第二张图片尺寸显示</span>

            <span class="help-block">您可以拖动图片改变其显示顺序 </span>

            {else}

            {loop $piclist $p}

            <a href='{php echo tomedia($p)}' target='_blank'>

                <img src="{php echo tomedia($p)}" style='height:100px;border:1px solid #ccc;padding:1px;float:left;margin-right:5px;' />

            </a>

            {/loop}

            {/if}

        </div>

    </div>



    <div class="form-group">

        <label class="col-sm-2 control-label"></label>

        <div class="col-sm-9 col-xs-12">

            {ife 'goods' $item}

            <label class="checkbox-inline"><input type="checkbox" name="thumb_first" value="1" {if $item['thumb_first'] == 1}checked="true"{/if}   /> 详情显示首图</label>

            <span class="help-block"></span>

            {else}

            <div class='form-control-static'>{if empty($item['thumb_first'])}否{else}是{/if}</div>

            {/if}

        </div>

    </div>

    {if p('app')}

    <div class="form-group">

        <label class="col-sm-2 control-label">首图视频</label>

        <div class="col-sm-9 col-xs-12">

            {php echo tpl_form_field_video2('video', $item['video'], array('disabled'=>!cv('goods.edit'), 'network'=>true, 'placeholder'=>'请选择视频'))}

            <div class='form-control-static'>设置后商品详情首图默认显示视频，目前仅支持小程序</div>

        </div>

    </div>

    {/if}



        <div class="form-group" {if $item['type']==10}style="display:none"{/if}>

        <label class="col-sm-2 control-label">已出售数</label>

        <div class="col-sm-6 col-xs-12">

            {ife 'goods' $item}

            <div class="input-group">

                <input type="text" name="sales" id="sales" class="form-control" value="{$item['sales']}" />

                <span class="input-group-addon">件</span>

            </div>

            {else}

            <div class='form-control-static'>{$item['sales']} 件</div>

            {/if}

        </div>

        </div>

        <div class="form-group">

            <label class="col-sm-2 control-label"></label>

            <div class="col-sm-9 col-xs-12">

                {ife 'goods' $item}

                <label class="checkbox-inline"><input type="checkbox" name="showsales" value="1" {if $item['showsales'] == 1}checked="true"{/if}   /> 显示销量</label>

                <span class="help-block"></span>

                {else}

                <div class='form-control-static'>{if empty($item['showsales'])}否{else}是{/if}</div>

                {/if}

            </div>

        </div>



    </div>

</div>







<div class="region-goods-details row">

    <div class="region-goods-left col-sm-2">

        商品属性

    </div>

    <div class="region-goods-right col-sm-10">

        <div class="form-group dispatch_info" {if ($item['type'] == 2 || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>

            <label class="col-sm-2 control-label">单品满件包邮</label>

            <div class="col-sm-8">

                {ife 'goods' $item}

                <div class='input-group fixsingle-input-group'>

                    <span class="input-group-addon">满</span>

                    <input type="text" name="ednum" value="{$item['ednum']}" class="form-control"/>

                    <span class="input-group-addon">件</span>

                </div>

                <span class="help-block">如果设置0或空，则不支持满件包邮</span>

                {else}

                <div class='form-control-static'>{if empty($item['ednum'])}不支持满件包邮{else}支持 {/if}</div>

                {/if}

            </div>

        </div>

        <div class="form-group dispatch_info" {if ($item['type'] == 2 || $item['isverify']==2  || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>

            <label class="col-sm-2 control-label">单品满额包邮</label>

            <div class="col-sm-8">

                {ife 'goods' $item}

                <div class='input-group fixsingle-input-group'>

                    <span class="input-group-addon">满</span>

                    <input type="text" name="edmoney" value="{$item['edmoney']}" class="form-control"/>

                    <span class="input-group-addon">元</span>

                </div>

                <span class="help-block">如果设置0或空，则不支持满额包邮</span>

                {else}

                <div class='form-control-static'>{if empty($item['edmoney'])}不支持满额包邮{else}支持 {/if}</div>

                {/if}

            </div>

        </div>

        <div class="form-group dispatch_info" {if ($item['type'] == 2  || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>

            <label class="col-sm-2 control-label">不参与单品包邮地区</label>

            <div class="col-sm-9 col-xs-12">

                {ife 'goods' $item}

                <div id="areas" class="form-control-static">{$item['edareas']}</div>

                <a href="javascript:;" class="btn btn-default" onclick="selectAreas()">添加不参加满包邮的地区</a>

                <input type="hidden" id='selectedareas' name="edareas" value="{$item['edareas']}"/>

                <input type="hidden" id='selectedareas_code' name="edareas_code" value="{$item['edareas_code']}"/>

                <span class="help-block">如果设置0或空，则不支持满件包邮</span>

                {else}

                <div class='form-control-static'>{$set['enoughareas']}</div>

                {/if}

            </div>

        </div>

        <div class="form-group dispatch_info" {if ($item['type'] == 2  || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>

        <label class="col-sm-2 control-label">运费设置</label>

        <div class="col-sm-6 col-xs-6" style='padding-left:0'>

            {ife 'goods' $item}

            <div class="input-group">

                <span class='input-group-addon' style='border:none'><label class="radio-inline" style='margin-top:-7px;' ><input type="radio" name="dispatchtype" value="0" {if empty($item['dispatchtype'])}checked="true"{/if}   /> 运费模板</label></span>

                <select class="form-control tpl-category-parent select2" id="dispatchid" name="dispatchid">

                    <option value="0">默认模板</option>

                    {loop $dispatch_data $dispatch_item}

                    <option value="{$dispatch_item['id']}" {if $item['dispatchid'] == $dispatch_item['id']}selected="true"{/if}>{$dispatch_item['dispatchname']}</option>

                    {/loop}

                </select>

            </div>

            <span class="help-block">如果开启了同城配送，系统优先使用同城配送方式，如果未开启同城配送或者超出同城配送范围则使用普通快递方式计算运费</span>

            {else}

            <div class='form-control-static'>{if empty($item['dispatchtype'])}运费模板 {if $item['dispatchid'] == 0}默认模板{else}{loop $dispatch_data $dispatch_item}{if $item['dispatchid'] == $dispatch_item['id']}{$dispatch_item['dispatchname']}{/if}{/loop}{/if}{else}统一邮费{/if}</div>

            {/if}

        </div>

    </div>

    {ife 'goods' $item}

    <div class="form-group dispatch_info"  {if ($item['type'] == 2  || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>

    <label class="col-sm-2 control-label"></label>

    <div class="col-sm-6 col-xs-6" style='padding-left:0'>

        <div class="input-group">

            <span class='input-group-addon' style='border:none'><label class="radio-inline"  style='margin-top:-7px;' ><input type="radio"name="dispatchtype" value="1" {if $item['dispatchtype'] == 1}checked="true"{/if}  /> 统一邮费</label></span>

            <input type="text" name="dispatchprice" id="dispatchprice" class="form-control" value="{$item['dispatchprice']}" />

            <span class="input-group-addon">元</span>

        </div>

        <span class="help-block">如果开启了同城配送，同城运费根据统一邮费进行计算</span>

    </div>

</div>

{/if}



<div class="form-group dispatch_info"  {if ($item['type'] == 2  || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>



<label class="col-sm-2 control-label">所在地</label>

    <div class="col-sm-6 col-xs-6">

        {ife 'goods' $item}



        <select id="sel-provance" name='province' onchange="selectCity();" class="form-control" style='width:200px;display: inline-block' >

            <option value="" selected="true">省/直辖市</option>

        </select>

        <select id="sel-city" name='city'  onchange="selectcounty(0)" class="form-control" style='width:200px;display: inline-block' >

            <option value="" selected="true">请选择</option>

        </select>

        <select id="sel-area" name='area'  class="form-control" style='width:200px;display: inline-block;display:none;' >

            <option value="" selected="true">请选择</option>

        </select>



        <span class='help-block'>商品所在地，显示在详情页面，如果不选择，则显示商城所在地</span>

        <script language='javascript'>

            cascdeInit("{php echo $new_area}","0","{$item['province']}","{$item['city']}","");

        </script>

        {else}

        <div class='form-control-static'>{$item['province']} {$item['province']}</div>

        {/if}

    </div>

</div>



{if p('cashier')}

<div class="form-group">

    <label class="col-sm-2 control-label">支持收银台</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="checkbox-inline"><input type="checkbox" name="cashier" value="1" {if !empty($item['cashier'])}checked="true"{/if}/> 支持</label>

        {else}

        <div class='form-control-static'>{if !empty($item['cashier'])}支持{else}不支持{/if}</div>

        {/if}

        <div class='help-block'>上架或者不上架,收银台都能查到!</div>

    </div>

</div>

{/if}



<div class="form-group dispatch_info"  {if ($item['type'] == 2  || $item['isverify']==2 || $item['type'] == 3 || $item['type'] == 5 || $item['type'] == 10)}style="display: none;"{/if}>



<label class="col-sm-2 control-label">货到付款</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="checkbox-inline">

        <input type="checkbox" name="cash" value="2" {if $item['cash'] =='2'}checked="true"{/if}  /> 支持

        </label>

        {else}

        <div class='form-control-static'>{if !empty($item['cash'])}支持{else}不支持{/if}</div>

        {/if}

    </div>

</div>

<div class="form-group">

    <label class="col-sm-2 control-label">发票</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="checkbox-inline"><input type="checkbox" name="invoice" value="1" {if !empty($item['invoice'])}checked="true"{/if}/> 支持</label>

        {else}

        <div class='form-control-static'>{if !empty($item['invoice'])}支持{else}不支持{/if}</div>

        {/if}

    </div>

</div>

<div class="form-group">

    <label class="col-sm-2 control-label">标签</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="checkbox-inline"><input type="checkbox" name="quality" value="1" {if !empty($item['quality'])}checked="true"{/if}   /> 正品保证</label>

        <label class="checkbox-inline"><input type="checkbox" name="seven" value="1" {if !empty($item['seven'])}checked="true"{/if}   /> 7天无理由退换</label>

        <label class="checkbox-inline"><input type="checkbox" name="repair" value="1" {if !empty($item['repair'])}checked="true"{/if}   /> 保修</label>

        {else}

        <div class='form-control-static'>

            {if !empty($item['quality'])}正品保证;{/if}

            {if !empty($item['seven'])}7天无理由退换;{/if}

            {if !empty($item['repair'])}保修;{/if}

        </div>

        {/if}

    </div>

</div>

<div class="form-group">

    <label class="col-sm-2 control-label">自定义标签</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <?php echo tpl_selector('labelname',

            array('text'=>'labelname',

        'multi'=>1,

        'type'=>'text',

        'placeholder'=>'自定义标签组名称',

        'buttontext'=>'选择标签',

        'items'=>$label,

        'nokeywords'=>1,

        'autosearch'=>1,

        'url'=>webUrl('goods/label/query')))?>

        {else}

        <div class='form-control-static'>

            {loop $labelname $label}

            {$label};

            {/loop}

        </div>

        {/if}

    </div>

</div>

<div class="form-group">

    <label class="col-sm-2 control-label">上架</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="radio-inline"><input type="radio" name="status" value="0" {if $item['status'] == 2}disabled{/if} {if empty($item['status'])}checked="true"{/if}/> 否</label>

        <label class="radio-inline"><input type="radio" name="status" value="1" {if $item['status'] == 2}disabled{/if} {if $item['status'] == 1}checked="true"{/if}   /> 上架</label>

        <label class="radio-inline"><input type="radio" name="status" value="2" {if $item['status'] == 2}readonly{/if} {if $item['status'] == 2}checked="true"{/if}   /> 赠品上架</label>

        <span class="help-block">赠品上架之后，状态不可更改。</span>

        {else}

        <div class='form-control-static'>{if empty($item['status'])}否{else}是{/if}</div>

        {/if}

    </div>

</div>

<div class="form-group">

    <label class="col-sm-2 control-label">是否选择上架时间</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="radio-inline"><input type="radio" name="isstatustime" value="1" {if $item['isstatustime'] == 1}checked="true"{/if}   /> 是</label>

        <label class="radio-inline"><input type="radio" name="isstatustime" value="0" {if empty($item['isstatustime'])}checked="true"{/if}/> 否</label>

        <span class="help-block">商品在选择时间内自动上架，过期自动下架</span>

        {else}

        <div class='form-control-static'>{if empty($item['isstatustime'])}否{else}是{/if}</div>

        {/if}

    </div>

</div>

<div id="shelves" class="form-group" {if $item['isstatustime']!=1}style="display:none"{/if}>

<label class="col-sm-2 control-label">

    上架时间

</label>

{ife 'goods' $item}

<div class="col-sm-4 col-xs-6">

    {php echo tpl_form_field_eweishop_daterange('statustime', array('starttime'=>date('Y-m-d H:i', $item['statustimestart']),'endtime'=>date('Y-m-d H:i', $item['statustimeend'])),true);}

</div>

{else}

<div class="col-sm-6 col-xs-6">

    <div class='form-control-static'>

        {if $item['status']==1} {php echo date('Y-m-d H:i',$item['statustimestart'])} - {php echo date('Y-m-d H:i',$item['statustimeend'])} {/if}

    </div>

</div>

{/if}

</div>





<div class="form-group">

    <label class="col-sm-2 control-label">主商城搜索结果中是否显示该商品</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="radio-inline"><input type="radio" name="nosearch" value="1" {if $item['nosearch'] == 1}checked="true"{/if}   /> 隐藏</label>

        <label class="radio-inline"><input type="radio" name="nosearch" value="0" {if empty($item['nosearch'])}checked="true"{/if}/> 显示</label>



        <span class="help-block">禁止后,在主商城搜索结果中,将不会显示该商品</span>

        {else}

        <div class='form-control-static'>{if empty($item['nosearch'])}显示{else}隐藏{/if}</div>

        {/if}

    </div>

</div>



{if p('groups')}

<div class="form-group" style="display: none;">

    <label class="col-sm-2 control-label">是否支持拼团</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="radio-inline"><input type="radio" name="groupstype" value="1" {if $item['groupstype'] == 1}checked="true"{/if}   /> 是</label>

        <label class="radio-inline"><input type="radio" name="groupstype" value="0" {if empty($item['groupstype'])}checked="true"{/if}/> 否</label>

        <span class="help-block"></span>

        {else}

        <div class='form-control-static'>{if empty($item['groupstype'])}否{else}是{/if}</div>

        {/if}

    </div>

</div>

{/if}





<div class="entity" {if ($item['type'] == 2 || $item['type'] == 3 || $item['type'] == 10)}style="display: none;"{/if}>

<div class="form-group">

    <label class="col-sm-2 control-label">是否支持退换货</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <label class="radio-inline"><input type="radio" name="cannotrefund" value="0" {if empty($item['cannotrefund'])}checked="true"{/if}   /> 是</label>

        <label class="radio-inline"><input type="radio" name="cannotrefund" value="1" {if !empty($item['cannotrefund'])}checked="true"{/if}/> 否</label>

        {else}

        <div class='form-control-static'>{if empty($item['cannotrefund'])}否{else}是{/if}</div>

        {/if}

    </div>

</div>



<div class="form-group">

    <label class="col-sm-2 control-label">确认收货时间</label>

    <div class="col-sm-9 col-xs-12">

        {ife 'goods' $item}

        <div class="input-group">



            <span class="input-group-addon">发货后</span>

            <input type="number" name="autoreceive" class="form-control valid" value="{$item['autoreceive']}">

            <span class="input-group-addon">天</span>

        </div>

        {else}

        <div class='form-control-static'>发货后{$item['autoreceive']}天自动收货</div>

        {/if}

        <div class="help-block">0读取系统设置 -1为不自动收货</div>

    </div>

</div>

</div>

    </div>

</div>







<script language="javascript">

    require(['jquery.ui'],function(){

        $('.multi-img-details').sortable({scroll:'false'});

        $('.multi-img-details').sortable('option', 'scroll', false);

        /*$('.multi-img-details').sortable({zIndex: 50 });



        $('.multi-img-details').sortable('option','zIndex', 50);*/

    })

    $(function () {

        $("input[name=isstatustime]").off('click').on('click',function () {

            if($(this).val()==1){

                $("#shelves").show()

            }else{

                $("#shelves").hide();

            }

        })

    })

</script>



{if empty($new_area)}

{template 'shop/selectareas'}

{else}

{template 'shop/selectareasNew'}

{/if}